package com.dragon.flow.utils;

import cn.hutool.core.util.RandomUtil;

/**
 * @title: 活动节点的工具类
 * @author: bruce.liu
 * @since: 2024/8/1 23:45
 */
public class FlowableActivityUtils {

    /**
     * 创建节点的id
     *
     * @param prefix 前缀
     * @return
     */
    public static String createActivityId(String prefix, Integer num) {
        String random = RandomUtil.randomString(num);
        return prefix + "_" + random;
    }

    public static String createActivityId(String prefix) {
        return FlowableActivityUtils.createActivityId(prefix, 7);
    }

    public static String createStr(Integer num) {
        return RandomUtil.randomString("abcdefghijklmnopqrstuvwxyz", num);
    }

    public static void main(String[] args) {
        System.out.println(FlowableActivityUtils.createActivityId("Activity"));
    }
}
